'\" t
.TH "SD_BUS_SET_CONNECTED_SIGNAL" "3" "" "systemd 249" "sd_bus_set_connected_signal"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sd_bus_set_connected_signal, sd_bus_get_connected_signal \- Control emission of local connection establishment signal on bus connections
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <systemd/sd\-bus\&.h>
.fi
.ft
.HP \w'int\ sd_bus_set_connected_signal('u
.BI "int sd_bus_set_connected_signal(sd_bus\ *" "bus" ", int\ " "b" ");"
.HP \w'int\ sd_bus_get_connected_signal('u
.BI "int sd_bus_get_connected_signal(sd_bus\ *" "bus" ");"
.SH "DESCRIPTION"
.PP
\fBsd_bus_set_connected_signal()\fR
may be used to control whether a local, synthetic
\fBConnected()\fR
signal message shall be generated and enqueued for dispatching when the connection is fully established\&. If the
\fIb\fR
parameter is zero the message is not generated (the default), otherwise it is generated\&.
.PP
\fBsd_bus_get_connected_signal()\fR
may be used to query whether this feature is enabled\&. It returns zero if not, positive otherwise\&.
.PP
The
\fBConnected()\fR
signal message is generated from the
"org\&.freedesktop\&.DBus\&.Local"
service and interface, and
"/org/freedesktop/DBus/Local"
object path\&. Use
\fBsd_bus_match_signal_async\fR(3)
to match on this signal\&.
.PP
This message is particularly useful on slow transports where connections take a long time to be established\&. This is especially the case when
\fBsd_bus_set_watch_bind\fR(3)
is used\&. The signal is generated when the
\fBsd_bus_is_ready\fR(3)
returns positive for the first time\&.
.PP
The
\fBConnected()\fR
signal corresponds with the
\fBDisconnected()\fR
signal that is synthesized locally when the connection is terminated\&. The latter is generated unconditionally however, unlike the former which needs to be enabled explicitly before it is generated, with
\fBsd_bus_set_connected_signal()\fR\&.
.SH "RETURN VALUE"
.PP
On success, these functions return 0 or a positive integer\&. On failure, they return a negative errno\-style error code\&.
.SS "Errors"
.PP
Returned errors may indicate the following problems:
.PP
\fB\-ECHILD\fR
.RS 4
The bus connection has been created in a different process\&.
.RE
.SH "NOTES"
.PP
These APIs are implemented as a shared library, which can be compiled and linked to with the
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
file\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsd-bus\fR(3),
\fBsd_bus_match_signal_async\fR(3),
\fBsd_bus_set_watch_bind\fR(3),
\fBsd_bus_is_ready\fR(3)
